package com.monitor.pubInter;

import io.swagger.annotations.ApiModelProperty;

/**
 * @author sunke
 * @Date 2019-09-10 09:45
 * @description 所有的search都继承此类
 */

public abstract class AbstractSourceBaseSearch<Sub> extends BaseSearch {

    public static Integer ALL_SOURCE = -1;//全部
    @ApiModelProperty(value = "来源匹配", hidden = true, example = "-1")
    private Integer source;

    public abstract String getSourceField();

    public Integer getSource() {
        return source;
    }

    public AbstractSourceBaseSearch setSource(Integer source) {
        this.source = source;
        if (source == null || source.intValue() == 0) {
            source = null;
        }
        setBitField(getSourceField(), source);
        return this;
    }


}
